package cn.hesion.thread.volatiletest;


public class ApiTest {
    public static void main(String[] args) {
        VT vt = new VT();
        Thread t1 = new Thread(vt);
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                vt.sign=true;
                System.out.println("vt.sign = true 通知 while (!sign) 结束！");
            }
        });

        t1.start();
        t2.start();
    }
}
